<?php
/* @var $this CmpMessageController */
/* @var $model CmpMessage */
/* @var $form CActiveForm */
//商品的所有咨询统计
$ralayStat = CmpMessage::model()->countByAttributes(array('zp_id'=>$model->zp_id));
?>
<div class="product_consult">
	<div class="pro_info c_f">
		<div class="view_all f_r">
			<?php echo CHtml::link("查看所有咨询(<strong class='c_06c'>$ralayStat</strong>)",array('admin','CmpMessage[zp_id]'=>$model->zp_id),array('class'=>'c_999'))?>
		</div>
		<div class="pro c_f f_l">
			<div class="c_img c_img60">
				<?php echo CHtml::link(Tool::thumb($model->product->zp_pic,50,50),array('/home/product/detail','id'=>$model->product->zp_id),array('target'=>'_blank'))?>
			</div>
			<p class="title_pro line_18">
        		<?php echo CHtml::link(str_cut($model->product->zp_name,60),array('/home/product/detail','id'=>$model->product->zp_id),array('class'=>'c_06c','target'=>'_blank'))?>
			</p>
			<p class="fw_b c_999">
				¥ <span class="c_f60"><?php echo $model->product->zp_price ?></span>
			</p>
		</div>
	</div>
	<div class="consult">
		<div class="box c_f">
			<p class="tit">
				<span class="man_bg ico_q"></span><span class="fw_b c_666">咨询内容：</span>
			</p>
			<div class="cont">
				<p class="question"><?php echo CHtml::encode($model->zcm_content)?></p>
				<p class="other c_999">
					<span class="mr20">咨询人：<a href="javascript:" title=""><?php echo CHtml::encode($model->zcm_name)?></a></span>
					<span>咨询时间：<?php echo date('Y-m-d H:i:s',$model->inputtime)?></span>
				</p>
			</div>
		</div>
		<div class="box c_f no_border">
			<?php
				$form = $this->beginWidget ( 'CActiveForm', array (
						'id' => 'cmp-message-form',
						'enableAjaxValidation' => false,
						'enableClientValidation' => true,
						'clientOptions' => array (
								'validateOnSubmit' => true 
						) 
				) );
				?>
				<p class="tit">
					<span class="man_bg ico_a"></span><span class="fw_b c_666">回复内容：</span>
				</p>
				<div class="cont">
					<?php echo $form->textArea($model,'zcm_reply',array('cols'=>'100','rows'=>'5'))?>
					<?php echo $form->error($model,'zcm_reply') ?>
				</div>	
				<div class="cont">
					<div class="submit">
						<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('glo','Create') : Yii::t('cmp','Replay'),array('class'=>'mem_btn mem_btn20 mr5')); ?>
					</div>
				</div>
			<?php $this->endWidget(); ?>
		</div>
	</div>
</div>


